import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 账单支付信息 */
export interface BillPay {
          id: number; // 编号
          billId?: number; // 账单编号
          userId?: number; // 用户编号
          paidAmount?: number; // 已付金额
          paymentMethod?: string; // 支付方式（'alipay','wechat','bank','cash'）
  }

// 账单支付 API
export const BillPayApi = {
  // 查询账单支付分页
  getBillPayPage: async (params: any) => {
    return await request.get({ url: `/dorm/bill-pay/page`, params })
  },

  // 查询账单支付详情
  getBillPay: async (id: number) => {
    return await request.get({ url: `/dorm/bill-pay/get?id=` + id })
  },

  // 新增账单支付
  createBillPay: async (data: BillPay) => {
    return await request.post({ url: `/dorm/bill-pay/create`, data })
  },

  // 修改账单支付
  updateBillPay: async (data: BillPay) => {
    return await request.put({ url: `/dorm/bill-pay/update`, data })
  },

  // 删除账单支付
  deleteBillPay: async (id: number) => {
    return await request.delete({ url: `/dorm/bill-pay/delete?id=` + id })
  },

  /** 批量删除账单支付 */
  deleteBillPayList: async (ids: number[]) => {
    return await request.delete({ url: `/dorm/bill-pay/delete-list?ids=${ids.join(',')}` })
  },

  // 导出账单支付 Excel
  exportBillPay: async (params) => {
    return await request.download({ url: `/dorm/bill-pay/export-excel`, params })
  },
}